@tom2012/cc-web 1.5.84 → 1.5.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/backend/dist/plan-control/templates.d.ts +1 -1
- package/backend/dist/plan-control/templates.d.ts.map +1 -1
- package/backend/dist/plan-control/templates.js +84 -2
- package/backend/dist/plan-control/templates.js.map +1 -1
- package/frontend/dist/assets/{GraphPreview-2WXuNUTC.js → GraphPreview-DpQuMdDo.js} +1 -1
- package/frontend/dist/assets/{OfficePreview-Ddn426ac.js → OfficePreview-CV9wU_VI.js} +2 -2
- package/frontend/dist/assets/{PlanPanel-CAwoVERS.js → PlanPanel-DZWBfnE8.js} +1 -1
- package/frontend/dist/assets/{ProjectPage-Bsmij9PR.js → ProjectPage-Deq1kcT4.js} +5 -5
- package/frontend/dist/assets/{SettingsPage-D_qkFpli.js → SettingsPage-D63sw2Ic.js} +1 -1
- package/frontend/dist/assets/{ShareViewPage-D_qyAmta.js → ShareViewPage-Ce9RPk10.js} +1 -1
- package/frontend/dist/assets/{SkillHubPage-C0FH24pf.js → SkillHubPage-B8zTjv4m.js} +3 -3
- package/frontend/dist/assets/{bot-BlJwFT2K.js → bot-BiaPkU_j.js} +1 -1
- package/frontend/dist/assets/{chevron-down-CK5p8rdp.js → chevron-down-DaForMZ1.js} +1 -1
- package/frontend/dist/assets/{download-CUOp54z9.js → download-D9mW-Nx-.js} +1 -1
- package/frontend/dist/assets/{index-BV5oU0la.js → index-6YjwjENM.js} +3 -3
- package/frontend/dist/assets/{index-0ybprEWn.js → index-CV3fvPu-.js} +1 -1
- package/frontend/dist/assets/index-DT0eASks.css +1 -0
- package/frontend/dist/assets/{jszip.min-5kkrvu4H.js → jszip.min-CWmc-JQg.js} +1 -1
- package/frontend/dist/assets/{maximize-2-CjNiqJGr.js → maximize-2-B2EYhurQ.js} +1 -1
- package/frontend/dist/assets/{save-DFFb1Eaz.js → save-DJgFglz7.js} +1 -1
- package/frontend/dist/assets/{user-JyvDYJ0V.js → user-XsJCdMEa.js} +1 -1
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-C8OaV-rT.css +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A self-hosted web application (distributed as npm package) that provides a browser-based interface for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI sessions. Create projects, each with a persistent terminal running Claude Code, and interact with them through a real-time terminal UI.
|
|
4
4
|
|
|
5
|
-
**Current version**: v1.5.
|
|
5
|
+
**Current version**: v1.5.86 | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const INIT_MD = "# Plan-Control \u521D\u59CB\u5316\u6307\u5F15\n\n\u4F60\u73B0\u5728\u5904\u4E8E Plan-Control \u521D\u59CB\u5316\u6A21\u5F0F\u3002\u8BF7\u6309\u4EE5\u4E0B\u6B65\u9AA4\u64CD\u4F5C\uFF1A\n\n## \u7B2C\u4E00\u6B65\uFF1A\u6DF1\u5EA6\u8BBF\u8C08\n\n\u5BF9\u7528\u6237\u8FDB\u884C\u6DF1\u5EA6\u8BBF\u8C08\uFF0C\u4E86\u89E3\uFF1A\n1. \u5177\u4F53\u76EE\u6807\u548C\u9884\u671F\u6210\u679C\n2. \u5F53\u524D\u53EF\u7528\u8D44\u6E90\uFF08\u8BA1\u7B97\u8D44\u6E90\u3001\u8FDC\u7A0B\u670D\u52A1\u5668\u3001API\u3001\u6570\u636E\u5E93\u7B49\uFF09\n3. \u7EA6\u675F\u6761\u4EF6\u548C\u4F18\u5148\u7EA7\n4. \u6210\u529F\u6807\u51C6\n\n## \u7B2C\u4E8C\u6B65\uFF1A\u5236\u5B9A\u8BA1\u5212\n\n\u57FA\u4E8E\u8BBF\u8C08\u7ED3\u679C\uFF0C\u5236\u5B9A\u8BE6\u7EC6\u7684\u6267\u884C\u8BA1\u5212\u3002\n\n## \u7B2C\u4E09\u6B65\uFF1A\u7F16\u5199 main.pc\n\n\u4F9D\u636E .plan-control/plan-code.md \u4E2D\u7684 pc \u8BED\u8A00\u89C4\u8303\uFF0C\u5C06\u8BA1\u5212\u7F16\u5199\u4E3A .plan-control/main.pc \u6587\u4EF6\u3002\n\n\u6CE8\u610F\u4E8B\u9879\
|
|
1
|
+
export declare const INIT_MD = "# Plan-Control \u521D\u59CB\u5316\u6307\u5F15\n\n\u4F60\u73B0\u5728\u5904\u4E8E Plan-Control \u521D\u59CB\u5316\u6A21\u5F0F\u3002\u8BF7\u6309\u4EE5\u4E0B\u6B65\u9AA4\u64CD\u4F5C\uFF1A\n\n## \u7B2C\u4E00\u6B65\uFF1A\u6DF1\u5EA6\u8BBF\u8C08\n\n\u5BF9\u7528\u6237\u8FDB\u884C\u6DF1\u5EA6\u8BBF\u8C08\uFF0C\u4E86\u89E3\uFF1A\n1. \u5177\u4F53\u76EE\u6807\u548C\u9884\u671F\u6210\u679C\n2. \u5F53\u524D\u53EF\u7528\u8D44\u6E90\uFF08\u8BA1\u7B97\u8D44\u6E90\u3001\u8FDC\u7A0B\u670D\u52A1\u5668\u3001API\u3001\u6570\u636E\u5E93\u7B49\uFF09\n3. \u7EA6\u675F\u6761\u4EF6\u548C\u4F18\u5148\u7EA7\n4. \u6210\u529F\u6807\u51C6\n\n## \u7B2C\u4E8C\u6B65\uFF1A\u5236\u5B9A\u8BA1\u5212\n\n\u57FA\u4E8E\u8BBF\u8C08\u7ED3\u679C\uFF0C\u5236\u5B9A\u8BE6\u7EC6\u7684\u6267\u884C\u8BA1\u5212\u3002\n\n## \u7B2C\u4E09\u6B65\uFF1A\u7F16\u5199 main.pc\n\n\u4F9D\u636E .plan-control/plan-code.md \u4E2D\u7684 pc \u8BED\u8A00\u89C4\u8303\uFF0C\u5C06\u8BA1\u5212\u7F16\u5199\u4E3A .plan-control/main.pc \u6587\u4EF6\u3002\n\n### \u26A0\uFE0F \u5173\u952E\uFF1Amain.pc \u662F\u53EF\u6267\u884C\u7684\u6307\u4EE4\u5E8F\u5217\uFF0C\u4E0D\u662F\u6587\u6863\n\nmain.pc \u4F1A\u88AB\u89E3\u6790\u5668\u9010\u884C\u6267\u884C\u3002\u5B83\u7684\u6BCF\u4E00\u884C\u8981\u4E48\u662F\u4E00\u6761\u6307\u4EE4\uFF0C\u8981\u4E48\u662F\u63A7\u5236\u6D41\u8BED\u53E5\u3002\u8BF7\u4E25\u683C\u9075\u5B88\u4EE5\u4E0B\u89C4\u5219\uFF1A\n\n**1. \\`task\\` \u662F\u5355\u884C\u6307\u4EE4\uFF0C\u4E0D\u662F section header**\n\n\u6BCF\u6761 \\`task\\` \u5FC5\u987B\u5199\u6210\u4E00\u884C\uFF0C\u628A\u6240\u6709\u4E0A\u4E0B\u6587\u4FE1\u606F\u538B\u7F29\u8FDB\u8FD9\u4E00\u884C\u7684\u81EA\u7136\u8BED\u8A00\u63CF\u8FF0\u4E2D\u3002\ntask \u540E\u9762\u4E0D\u80FD\u8DDF\u7F29\u8FDB\u7684\u5B50\u5185\u5BB9\u2014\u2014\u89E3\u6790\u5668\u4F1A\u5C06\u7F29\u8FDB\u5185\u5BB9\u89C6\u4E3A\u63A7\u5236\u6D41\u5757\u3002\n\n\\`\\`\\`\n# \u2705 \u6B63\u786E\uFF1A\u5355\u884C task\uFF0C\u63CF\u8FF0\u5B8C\u6574\u5177\u4F53\ntask \u521B\u5EFAVite+Babylon.js\u9879\u76EE\u7ED3\u6784(package.json/vite.config.js/index.html/src/main.js)\ntask \u914D\u7F6E3D\u573A\u666F(ArcRotateCamera/\u73AF\u5883\u5149/\u805A\u5149\u706F/\u5B9E\u9A8C\u5BA4\u5730\u677F\u5899\u58C1/\u96FE\u6548)\n\n# \u274C \u9519\u8BEF\uFF1A\u628A task \u5F53\u6210\u6807\u9898\uFF0C\u4E0B\u9762\u8DDF\u591A\u884C\u63CF\u8FF0\ntask \u521D\u59CB\u5316\u9879\u76EE\n \u521B\u5EFA\u57FA\u4E8EVite\u7684\u9879\u76EE\u7ED3\u6784:\n - package.json\u914D\u7F6E\u4F9D\u8D56\n - vite.config.js\u914D\u7F6E\n\\`\\`\\`\n\n**2. \\`call\\` \u53EA\u63A5\u53D7\u5B57\u9762\u51FD\u6570\u540D\uFF0C\u4E0D\u652F\u6301\u52A8\u6001\u5206\u6D3E**\n\n\\`call\\` \u540E\u9762\u5FC5\u987B\u5199\u5B9A\u4E49\u8FC7\u7684\u51FD\u6570\u540D\uFF0C\u4E0D\u80FD\u7528\u53D8\u91CF\uFF08\\`call ${name}\\` \u662F\u975E\u6CD5\u7684\uFF09\u3002\n\n\\`\\`\\`\n# \u2705 \u6B63\u786E\nfunc \u5904\u7406\u6570\u636E(source):\n task \u4ECE${source}\u4E0B\u8F7D\u5E76\u5904\u7406\u6570\u636E\n\ncall \u5904\u7406\u6570\u636E(${db_name})\n\n# \u274C \u9519\u8BEF\uFF1Acall \u4E0D\u652F\u6301\u53D8\u91CF\u505A\u51FD\u6570\u540D\ntasks = [\u521D\u59CB\u5316, \u6784\u5EFA, \u6D4B\u8BD5]\nfor t in ${tasks}:\n call ${t}\n\\`\\`\\`\n\n**3. \u987A\u5E8F\u6267\u884C\u4E0D\u9700\u8981\u5217\u8868+\u5FAA\u73AF**\n\n\u5982\u679C\u4EFB\u52A1\u4E4B\u95F4\u662F\u7B80\u5355\u7684\u987A\u5E8F\u4F9D\u8D56\uFF0C\u76F4\u63A5\u9010\u884C\u5199 task \u5373\u53EF\u3002\n\u53EA\u6709\"\u5BF9\u4E00\u7EC4\u540C\u7C7B\u6570\u636E\u6267\u884C\u76F8\u540C\u64CD\u4F5C\"\u65F6\u624D\u9700\u8981 for \u5FAA\u73AF\u3002\n\n\\`\\`\\`\n# \u2705 \u6B63\u786E\uFF1A\u987A\u5E8F\u4EFB\u52A1\u76F4\u63A5\u9010\u884C\u5199\ntask \u521D\u59CB\u5316\u9879\u76EE\u7ED3\u6784\ntask \u521B\u5EFA3D\u573A\u666F\u57FA\u7840\ntask \u6784\u5EFA\u4EEA\u5668\u6A21\u578B\ntask \u6DFB\u52A0\u7528\u6237\u4EA4\u4E92\ntask \u6D4B\u8BD5\u9A8C\u8BC1\n\n# \u274C \u9519\u8BEF\uFF1A\u628A\u6B65\u9AA4\u540D\u585E\u8FDB\u5217\u8868\u518D\u5FAA\u73AF\u2014\u2014\u65E0\u610F\u4E49\u7684\u590D\u6742\u5316\nsteps = [\u521D\u59CB\u5316, \u573A\u666F, \u6A21\u578B, \u4EA4\u4E92, \u6D4B\u8BD5]\nfor s in ${steps}:\n task \u6267\u884C${s}\n\\`\\`\\`\n\n**4. main.pc \u4E2D\u4E0D\u8981\u5199\u5927\u6BB5 Markdown \u6587\u6863**\n\n\u6CE8\u91CA\uFF08\\`#\\` \u5F00\u5934\uFF09\u7528\u4E8E\u7B80\u77ED\u8BF4\u660E\u5373\u53EF\u3002\u9879\u76EE\u6982\u8FF0\u3001\u6280\u672F\u9009\u578B\u3001\u8BE6\u7EC6\u9700\u6C42\u7B49\u4FE1\u606F\u5E94\u8BE5\u5728\u8BBF\u8C08\u9636\u6BB5\u4E0E\u7528\u6237\u786E\u8BA4\uFF0C\u4E0D\u9700\u8981\u5199\u5165 main.pc\u3002main.pc \u8981\u4FDD\u6301\u7CBE\u7B80\u2014\u2014\u5B83\u662F\u6267\u884C\u84DD\u56FE\uFF0C\u4E0D\u662F\u9879\u76EE\u6587\u6863\u3002\n\n**5. for \u5FAA\u73AF\u7684\u6B63\u786E\u573A\u666F\uFF1A\u540C\u7C7B\u64CD\u4F5C \u00D7 \u591A\u4E2A\u6570\u636E**\n\n\\`\\`\\`\n# \u2705 \u6B63\u786E\uFF1A10\u79CD\u4EEA\u5668\u6267\u884C\u76F8\u540C\u7684\u5EFA\u6A21\u64CD\u4F5C\ninstruments = [XRD, FT-IR, Raman, NMR, MS, UV-Vis, GC-MS, LC-MS, XPS, AAS]\nfor inst in ${instruments}:\n task \u4E3A${inst}\u521B\u5EFA\u7A0B\u5E8F\u53163D\u6A21\u578B\u5E76\u6DFB\u52A0PBR\u6750\u8D28\n\\`\\`\\`\n\n### \u5176\u4ED6\u6CE8\u610F\u4E8B\u9879\n\n- \u4F7F\u7528 2 \u7A7A\u683C\u7F29\u8FDB\n- task \u63CF\u8FF0\u8981\u5177\u4F53\u660E\u786E\uFF0C\u6267\u884C\u65F6\u7684 AI \u80FD\u7406\u89E3\u4E0A\u4E0B\u6587\n- \u5408\u7406\u4F7F\u7528 if/for/loop \u63A7\u5236\u6D41\n- \u9700\u8981\u8FD4\u56DE\u503C\u65F6\u4F7F\u7528 \\`\u53D8\u91CF = task \u63CF\u8FF0\\` \u8BED\u6CD5\n\n## \u53CD\u9988\u901A\u9053\n\n\u5728\u7F16\u5199 main.pc \u7684\u8FC7\u7A0B\u4E2D\uFF0C\u5982\u679C\u4F60\u53D1\u73B0\u5F53\u524D pc \u8BED\u8A00\u7684\u8BED\u6CD5\u89C4\u8303\u9650\u5236\u4E86\u4F60\u5BF9\u8BA1\u5212\u7684\u8868\u8FBE\u2014\u2014\u4F8B\u5982\u7F3A\u5C11\u67D0\u79CD\u63A7\u5236\u7ED3\u6784\u3001\u53D8\u91CF\u64CD\u4F5C\u4E0D\u591F\u7075\u6D3B\u3001\u65E0\u6CD5\u63CF\u8FF0\u67D0\u7C7B\u4EFB\u52A1\u4F9D\u8D56\u7B49\u2014\u2014\u8BF7\u5C06\u4F60\u7684\u53CD\u9988\u5199\u5165 \\`.plan-control/dsl-feedback.md\\` \u6587\u4EF6\u3002\n\n\u53CD\u9988\u5185\u5BB9\u53EF\u4EE5\u5305\u62EC\uFF1A\n- \u4F60\u60F3\u8868\u8FBE\u4F46\u65E0\u6CD5\u5B9E\u73B0\u7684\u8BA1\u5212\u903B\u8F91\n- \u4F60\u8BA4\u4E3A\u7F3A\u5931\u6216\u9700\u8981\u6539\u8FDB\u7684\u8BED\u6CD5\u7279\u6027\n- \u5177\u4F53\u7684\u573A\u666F\u63CF\u8FF0\u548C\u4F60\u671F\u671B\u7684\u5199\u6CD5\n\n\u8FD9\u4E9B\u53CD\u9988\u4F1A\u5E2E\u52A9\u6211\u4EEC\u6301\u7EED\u6539\u8FDB pc \u8BED\u8A00\u3002\u8BF7\u653E\u5FC3\u63D0\u51FA\uFF0C\u4E0D\u4F1A\u5F71\u54CD\u5F53\u524D\u8BA1\u5212\u7684\u6267\u884C\u3002\n";
|
|
2
2
|
export declare const OUTPUT_FORMAT_MD = "# \u8282\u70B9\u8F93\u51FA\u683C\u5F0F\n\n\u4EFB\u52A1\u5B8C\u6210\u540E\uFF0C\u8BF7\u66F4\u65B0\u6307\u5B9A\u7684 JSON \u6587\u4EF6\uFF0C\u4E25\u683C\u6309\u4EE5\u4E0B\u683C\u5F0F\uFF1A\n\n\\`\\`\\`json\n{\n \"status\": \"success | failed | blocked | replan\",\n \"result\": null,\n \"summary\": \"\",\n \"request_replan\": false,\n \"replan_reason\": \"\"\n}\n\\`\\`\\`\n\n## \u5B57\u6BB5\u8BF4\u660E\n\n| \u5B57\u6BB5 | \u5FC5\u586B | \u7C7B\u578B | \u8BF4\u660E |\n|------|------|------|------|\n| status | \u662F | string | success=\u5B8C\u6210 / failed=\u5931\u8D25 / blocked=\u9700\u4EBA\u5DE5\u4ECB\u5165 / replan=\u8BA1\u5212\u9700\u8C03\u6574 |\n| result | \u662F | bool/string/array | \u8FD4\u56DE\u503C\u3002\u5E03\u5C14\u503C\u4F9B if \u5224\u65AD\uFF0C\u5217\u8868\u4F9B for \u904D\u5386\uFF0C\u5B57\u7B26\u4E32\u4F9B\u63D2\u503C |\n| summary | \u662F | string | \u4E00\u53E5\u8BDD\u63CF\u8FF0\u6267\u884C\u7ED3\u679C |\n| request_replan | \u5426 | bool | \u5982\u8BA4\u4E3A\u540E\u7EED\u8BA1\u5212\u9700\u8981\u8C03\u6574\uFF0C\u8BBE\u4E3A true |\n| replan_reason | \u5426 | string | \u5F53 request_replan=true \u65F6\u5FC5\u586B\uFF0C\u8BF4\u660E\u8C03\u6574\u539F\u56E0 |\n\n## \u793A\u4F8B\n\n\u4EFB\u52A1\u6210\u529F\u5E76\u8FD4\u56DE\u5217\u8868\uFF1A\n\\`\\`\\`json\n{\n \"status\": \"success\",\n \"result\": [\"PubChem\", \"NIST\"],\n \"summary\": \"\u68C0\u6D4B\u52302\u4E2A\u53EF\u7528\u7684\u5F00\u6E90\u5206\u5B50\u6570\u636E\u5E93\"\n}\n\\`\\`\\`\n\n\u4EFB\u52A1\u5931\u8D25\uFF1A\n\\`\\`\\`json\n{\n \"status\": \"failed\",\n \"result\": false,\n \"summary\": \"PubChem API \u8FD4\u56DE 503\uFF0C\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\"\n}\n\\`\\`\\`\n";
|
|
3
3
|
export declare const PLAN_CODE_MD = "# pc \u8BED\u8A00\u89C4\u8303\n\n## \u57FA\u7840\u8BED\u6CD5\n\n- \u56FA\u5B9A 2 \u7A7A\u683C\u7F29\u8FDB\uFF08\u4E0D\u5141\u8BB8 tab\uFF09\n- \u4EFB\u52A1\u63CF\u8FF0\u4E3A\u7EAF\u81EA\u7136\u8BED\u8A00\uFF0C\u4E0D\u9700\u8981\u5F15\u53F7\n- \u53D8\u91CF\u5F15\u7528\u7EDF\u4E00\u4F7F\u7528 \\`${\u53D8\u91CF\u540D}\\` \u8BED\u6CD5\n\n## \u5173\u952E\u5B57\n\n| \u5173\u952E\u5B57 | \u793A\u4F8B |\n|--------|------|\n| task | \\`task \u4ECEPubChem\u4E0B\u8F7D\u5019\u9009\u5206\u5B50\\` |\n| if/elif/else | \\`if success:\\` / \\`elif failed:\\` / \\`else:\\` |\n| for...in | \\`for db in ${databases}:\\` |\n| loop N | \\`loop 3:\\` / \\`loop 5 as i:\\` |\n| func/call | \\`func \u8BA1\u7B97(targets):\\` / \\`call \u8BA1\u7B97(${molecules})\\` |\n| break | \u8DF3\u51FA\u6700\u5185\u5C42\u5FAA\u73AF |\n| continue | \u8DF3\u5230\u4E0B\u4E00\u6B21\u8FED\u4EE3 |\n| return | \u4ECE\u51FD\u6570\u8FD4\u56DE |\n\n## \u53D8\u91CF\n\n\u9759\u6001\u5B9A\u4E49\uFF08\u4EC5\u5217\u8868\uFF09\uFF1A\n\\`\\`\\`\ndatabases = [PubChem, ZINC, ChEMBL]\n\\`\\`\\`\n\n\u52A8\u6001\u8D4B\u503C\uFF08task\u8FD4\u56DE\u503C\uFF09\uFF1A\n\\`\\`\\`\nresults = task \u67E5\u8BE2\u6240\u6709\u6570\u636E\u5E93\n\\`\\`\\`\n\n## \u6761\u4EF6\u5224\u65AD\n\n\u57FA\u4E8E\u6700\u8FD1 task \u7684\u72B6\u6001\uFF1A\\`success\\` / \\`failed\\` / \\`blocked\\`\n\u53D8\u91CF\u6761\u4EF6\uFF1A\\`if ${has_gpu}:\\` \u68C0\u67E5 truthy\n\n## \u5B8C\u6574\u793A\u4F8B\n\n\\`\\`\\`\nmethods = [ML\u9884\u6D4B, xtb\u8BA1\u7B97, DFT\u8BA1\u7B97]\n\nfunc \u6027\u8D28\u8BA1\u7B97(targets, method_list):\n for m in ${method_list}:\n results = task \u4F7F\u7528${m}\u8BA1\u7B97${targets}\u7684\u6027\u8D28\n if success:\n return\n task \u6240\u6709\u65B9\u6CD5\u5747\u5931\u8D25\uFF0C\u8BF7\u5206\u6790\u539F\u56E0\n\ndatabases = task \u67E5\u8BE2\u6240\u6709\u5F00\u6E90\u5206\u5B50\u6570\u636E\u5E93\nfor db in ${databases}:\n task \u4ECE${db}\u4E0B\u8F7D\u5019\u9009\u5206\u5B50\n if success:\n molecules = task \u63D0\u53D6\u5019\u9009\u5206\u5B50\u5217\u8868\n call \u6027\u8D28\u8BA1\u7B97(${molecules}, ${methods})\n break\n\ntask \u751F\u6210\u6700\u7EC8\u62A5\u544A\n\\`\\`\\`\n";
|
|
4
4
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/plan-control/templates.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/plan-control/templates.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,k+MA2GnB,CAAC;AAEF,eAAO,MAAM,gBAAgB,qqDA2C5B,CAAC;AAEF,eAAO,MAAM,YAAY,moEA4DxB,CAAC"}
|
|
@@ -22,11 +22,93 @@ exports.INIT_MD = `# Plan-Control 初始化指引
|
|
|
22
22
|
|
|
23
23
|
依据 .plan-control/plan-code.md 中的 pc 语言规范,将计划编写为 .plan-control/main.pc 文件。
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### ⚠️ 关键:main.pc 是可执行的指令序列,不是文档
|
|
26
|
+
|
|
27
|
+
main.pc 会被解析器逐行执行。它的每一行要么是一条指令,要么是控制流语句。请严格遵守以下规则:
|
|
28
|
+
|
|
29
|
+
**1. \\\`task\\\` 是单行指令,不是 section header**
|
|
30
|
+
|
|
31
|
+
每条 \\\`task\\\` 必须写成一行,把所有上下文信息压缩进这一行的自然语言描述中。
|
|
32
|
+
task 后面不能跟缩进的子内容——解析器会将缩进内容视为控制流块。
|
|
33
|
+
|
|
34
|
+
\\\`\\\`\\\`
|
|
35
|
+
# ✅ 正确:单行 task,描述完整具体
|
|
36
|
+
task 创建Vite+Babylon.js项目结构(package.json/vite.config.js/index.html/src/main.js)
|
|
37
|
+
task 配置3D场景(ArcRotateCamera/环境光/聚光灯/实验室地板墙壁/雾效)
|
|
38
|
+
|
|
39
|
+
# ❌ 错误:把 task 当成标题,下面跟多行描述
|
|
40
|
+
task 初始化项目
|
|
41
|
+
创建基于Vite的项目结构:
|
|
42
|
+
- package.json配置依赖
|
|
43
|
+
- vite.config.js配置
|
|
44
|
+
\\\`\\\`\\\`
|
|
45
|
+
|
|
46
|
+
**2. \\\`call\\\` 只接受字面函数名,不支持动态分派**
|
|
47
|
+
|
|
48
|
+
\\\`call\\\` 后面必须写定义过的函数名,不能用变量(\\\`call \${name}\\\` 是非法的)。
|
|
49
|
+
|
|
50
|
+
\\\`\\\`\\\`
|
|
51
|
+
# ✅ 正确
|
|
52
|
+
func 处理数据(source):
|
|
53
|
+
task 从\${source}下载并处理数据
|
|
54
|
+
|
|
55
|
+
call 处理数据(\${db_name})
|
|
56
|
+
|
|
57
|
+
# ❌ 错误:call 不支持变量做函数名
|
|
58
|
+
tasks = [初始化, 构建, 测试]
|
|
59
|
+
for t in \${tasks}:
|
|
60
|
+
call \${t}
|
|
61
|
+
\\\`\\\`\\\`
|
|
62
|
+
|
|
63
|
+
**3. 顺序执行不需要列表+循环**
|
|
64
|
+
|
|
65
|
+
如果任务之间是简单的顺序依赖,直接逐行写 task 即可。
|
|
66
|
+
只有"对一组同类数据执行相同操作"时才需要 for 循环。
|
|
67
|
+
|
|
68
|
+
\\\`\\\`\\\`
|
|
69
|
+
# ✅ 正确:顺序任务直接逐行写
|
|
70
|
+
task 初始化项目结构
|
|
71
|
+
task 创建3D场景基础
|
|
72
|
+
task 构建仪器模型
|
|
73
|
+
task 添加用户交互
|
|
74
|
+
task 测试验证
|
|
75
|
+
|
|
76
|
+
# ❌ 错误:把步骤名塞进列表再循环——无意义的复杂化
|
|
77
|
+
steps = [初始化, 场景, 模型, 交互, 测试]
|
|
78
|
+
for s in \${steps}:
|
|
79
|
+
task 执行\${s}
|
|
80
|
+
\\\`\\\`\\\`
|
|
81
|
+
|
|
82
|
+
**4. main.pc 中不要写大段 Markdown 文档**
|
|
83
|
+
|
|
84
|
+
注释(\\\`#\\\` 开头)用于简短说明即可。项目概述、技术选型、详细需求等信息应该在访谈阶段与用户确认,不需要写入 main.pc。main.pc 要保持精简——它是执行蓝图,不是项目文档。
|
|
85
|
+
|
|
86
|
+
**5. for 循环的正确场景:同类操作 × 多个数据**
|
|
87
|
+
|
|
88
|
+
\\\`\\\`\\\`
|
|
89
|
+
# ✅ 正确:10种仪器执行相同的建模操作
|
|
90
|
+
instruments = [XRD, FT-IR, Raman, NMR, MS, UV-Vis, GC-MS, LC-MS, XPS, AAS]
|
|
91
|
+
for inst in \${instruments}:
|
|
92
|
+
task 为\${inst}创建程序化3D模型并添加PBR材质
|
|
93
|
+
\\\`\\\`\\\`
|
|
94
|
+
|
|
95
|
+
### 其他注意事项
|
|
96
|
+
|
|
26
97
|
- 使用 2 空格缩进
|
|
27
|
-
- task
|
|
98
|
+
- task 描述要具体明确,执行时的 AI 能理解上下文
|
|
28
99
|
- 合理使用 if/for/loop 控制流
|
|
29
100
|
- 需要返回值时使用 \\\`变量 = task 描述\\\` 语法
|
|
101
|
+
|
|
102
|
+
## 反馈通道
|
|
103
|
+
|
|
104
|
+
在编写 main.pc 的过程中,如果你发现当前 pc 语言的语法规范限制了你对计划的表达——例如缺少某种控制结构、变量操作不够灵活、无法描述某类任务依赖等——请将你的反馈写入 \\\`.plan-control/dsl-feedback.md\\\` 文件。
|
|
105
|
+
|
|
106
|
+
反馈内容可以包括:
|
|
107
|
+
- 你想表达但无法实现的计划逻辑
|
|
108
|
+
- 你认为缺失或需要改进的语法特性
|
|
109
|
+
- 具体的场景描述和你期望的写法
|
|
110
|
+
|
|
111
|
+
这些反馈会帮助我们持续改进 pc 语言。请放心提出,不会影响当前计划的执行。
|
|
30
112
|
`;
|
|
31
113
|
exports.OUTPUT_FORMAT_MD = `# 节点输出格式
|
|
32
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/plan-control/templates.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;AAE3B,QAAA,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/plan-control/templates.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;AAE3B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GtB,CAAC;AAEW,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C/B,CAAC;AAEW,QAAA,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D3B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,d as t,j as n,B as i,m as r}from"./index-
|
|
1
|
+
import{r as e,d as t,j as n,B as i,m as r}from"./index-6YjwjENM.js";import{L as o,Z as a,a as s}from"./ProjectPage-Deq1kcT4.js";import{M as l}from"./maximize-2-B2EYhurQ.js";import"./save-DJgFglz7.js";import"./download-D9mW-Nx-.js";import"./chevron-down-DaForMZ1.js";import"./bot-BiaPkU_j.js";import"./user-XsJCdMEa.js";
|
|
2
2
|
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function c(e){return null==e}var u={isNothing:c,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:c(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;n<t;n+=1)i+=e;return i},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,i,r,o;if(t)for(n=0,i=(o=Object.keys(t)).length;n<i;n+=1)e[r=o[n]]=t[r];return e}};function p(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}function f(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=p(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f.prototype.toString=function(e){return this.name+": "+p(this,e)};var d=f;function h(e,t,n,i,r){var o="",a="",s=Math.floor(r/2)-1;return i-t>s&&(t=i-s+(o=" ... ").length),n-i>s&&(n=i+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+o.length}}function m(e,t){return u.repeat(" ",t-e.length)+e}var g=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],o=[],a=-1;n=i.exec(e.buffer);)o.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var s,l,c="",p=Math.min(e.line+t.linesAfter,o.length).toString().length,f=t.maxLength-(t.indent+p+3);for(s=1;s<=t.linesBefore&&!(a-s<0);s++)l=h(e.buffer,r[a-s],o[a-s],e.position-(r[a]-r[a-s]),f),c=u.repeat(" ",t.indent)+m((e.line-s+1).toString(),p)+" | "+l.str+"\n"+c;for(l=h(e.buffer,r[a],o[a],e.position,f),c+=u.repeat(" ",t.indent)+m((e.line+1).toString(),p)+" | "+l.str+"\n",c+=u.repeat("-",t.indent+p+3+l.pos)+"^\n",s=1;s<=t.linesAfter&&!(a+s>=o.length);s++)l=h(e.buffer,r[a+s],o[a+s],e.position-(r[a]-r[a+s]),f),c+=u.repeat(" ",t.indent)+m((e.line+s+1).toString(),p)+" | "+l.str+"\n";return c.replace(/\n$/,"")},b=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],y=["scalar","sequence","mapping"];var x=function(e,t){var n,i;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===b.indexOf(t))throw new d('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,i={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){i[String(t)]=e})}),i),-1===y.indexOf(this.kind))throw new d('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function A(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)}),n[t]=e}),n}function v(e){return this.extend(e)}v.prototype.extend=function(e){var t=[],n=[];if(e instanceof x)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new d("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach(function(e){if(!(e instanceof x))throw new d("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new d("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new d("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(e){if(!(e instanceof x))throw new d("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(v.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=A(i,"implicit"),i.compiledExplicit=A(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var k=new v({explicit:[new x("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),new x("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),new x("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})]});var w=new x("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var C=new x("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function j(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function I(e){return 48<=e&&e<=55}function S(e){return 48<=e&&e<=57}var N=new x("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n=e.length,i=0,r=!1;if(!n)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===n)return!0;if("b"===(t=e[++i])){for(i++;i<n;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;r=!0}return r&&"_"!==t}if("x"===t){for(i++;i<n;i++)if("_"!==(t=e[i])){if(!j(e.charCodeAt(i)))return!1;r=!0}return r&&"_"!==t}if("o"===t){for(i++;i<n;i++)if("_"!==(t=e[i])){if(!I(e.charCodeAt(i)))return!1;r=!0}return r&&"_"!==t}}if("_"===t)return!1;for(;i<n;i++)if("_"!==(t=e[i])){if(!S(e.charCodeAt(i)))return!1;r=!0}return!(!r||"_"===t)},construct:function(e){var t,n=e,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(i=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!u.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),M=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var O=/^[-+]?[0-9]+e/;var T=new x("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!M.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||u.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(u.isNegativeZero(e))return"-0.0";return n=e.toString(10),O.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),E=k.extend({implicit:[w,C,N,T]}),L=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),F=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var _=new x("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==L.exec(e)||null!==F.exec(e))},construct:function(e){var t,n,i,r,o,a,s,l,c=0,u=null;if(null===(t=L.exec(e))&&(t=F.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),l=new Date(Date.UTC(n,i,r,o,a,s,c)),u&&l.setTime(l.getTime()-u),l},instanceOf:Date,represent:function(e){return e.toISOString()}});var $=new x("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var D=new x("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=Y;for(n=0;n<r;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=Y,a=0,s=[];for(t=0;t<r;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0===(n=r%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=Y;for(t=0;t<o;t++)t%3==0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),U=Object.prototype.hasOwnProperty,q=Object.prototype.toString;var B=new x("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=[],s=e;for(t=0,n=s.length;t<n;t+=1){if(i=s[t],o=!1,"[object Object]"!==q.call(i))return!1;for(r in i)if(U.call(i,r)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0},construct:function(e){return null!==e?e:[]}}),R=Object.prototype.toString;var z=new x("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(i=a[t],"[object Object]"!==R.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;o[t]=[r[0],i[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}}),W=Object.prototype.hasOwnProperty;var P=new x("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(W.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),G=E.extend({implicit:[_,$],explicit:[D,B,z,P]}),Z=Object.prototype.hasOwnProperty,V=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,X=/[\x85\u2028\u2029]/,H=/[,\[\]\{\}]/,K=/^(?:!|!!|![a-z\-]+!)$/i,J=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Q(e){return Object.prototype.toString.call(e)}function ee(e){return 10===e||13===e}function te(e){return 9===e||32===e}function ne(e){return 9===e||32===e||10===e||13===e}function ie(e){return 44===e||91===e||93===e||123===e||125===e}function re(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function oe(e){return 120===e?2:117===e?4:85===e?8:0}function ae(e){return 48<=e&&e<=57?e-48:-1}function se(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function le(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function ce(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var ue=new Array(256),pe=new Array(256),fe=0;fe<256;fe++)ue[fe]=se(fe)?1:0,pe[fe]=se(fe);function de(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||G,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function he(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=g(n),new d(t,n)}function me(e,t){throw he(e,t)}function ge(e,t){e.onWarning&&e.onWarning.call(null,he(e,t))}var be={YAML:function(e,t,n){var i,r,o;null!==e.version&&me(e,"duplication of %YAML directive"),1!==n.length&&me(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&me(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&me(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&ge(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&me(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],K.test(i)||me(e,"ill-formed tag handle (first argument) of the TAG directive"),Z.call(e.tagMap,i)&&me(e,'there is a previously declared suffix for "'+i+'" tag handle'),J.test(r)||me(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(o){me(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function ye(e,t,n,i){var r,o,a,s;if(t<n){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;r<o;r+=1)9===(a=s.charCodeAt(r))||32<=a&&a<=1114111||me(e,"expected valid JSON character");else V.test(s)&&me(e,"the stream contains non-printable characters");e.result+=s}}function xe(e,t,n,i){var r,o,a,s;for(u.isObject(n)||me(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(r=Object.keys(n)).length;a<s;a+=1)o=r[a],Z.call(t,o)||(ce(t,o,n[o]),i[o]=!0)}function Ae(e,t,n,i,r,o,a,s,l){var c,u;if(Array.isArray(r))for(c=0,u=(r=Array.prototype.slice.call(r)).length;c<u;c+=1)Array.isArray(r[c])&&me(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===Q(r[c])&&(r[c]="[object Object]");if("object"==typeof r&&"[object Object]"===Q(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)xe(e,t,o[c],n);else xe(e,t,o,n);else e.json||Z.call(n,r)||!Z.call(t,r)||(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,me(e,"duplicated mapping key")),ce(t,r,o),delete n[r];return t}function ve(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):me(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ke(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);0!==r;){for(;te(r);)9===r&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!ee(r))break;for(ve(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&ge(e,"deficient indentation"),i}function we(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!ne(t)))}function Ce(e,t){1===t?e.result+=" ":t>1&&(e.result+=u.repeat("\n",t-1))}function je(e,t){var n,i,r=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,me(e,"tab characters must not be used in indentation")),45===i)&&ne(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,ke(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,Ne(e,t,3,!1,!0),a.push(e.result),ke(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)me(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=r,e.anchor=o,e.kind="sequence",e.result=a,!0)}function Ie(e){var t,n,i,r,o=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&me(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(o=!0,r=e.input.charCodeAt(++e.position)):33===r?(a=!0,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(i=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):me(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!ne(r);)33===r&&(a?me(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),K.test(n)||me(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),H.test(i)&&me(e,"tag suffix cannot contain flow indicator characters")}i&&!J.test(i)&&me(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(s){me(e,"tag name is malformed: "+i)}return o?e.tag=i:Z.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:me(e,'undeclared tag handle "'+n+'"'),!0}function Se(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&me(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!ne(n)&&!ie(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&me(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ne(e,t,n,i,r){var o,a,s,l,c,p,f,d,h,m=1,g=!1,b=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=4===n||3===n,i&&ke(e,!0,-1)&&(g=!0,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)),1===m)for(;Ie(e)||Se(e);)ke(e,!0,-1)?(g=!0,s=o,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):s=!1;if(s&&(s=g||r),1!==m&&4!==n||(d=1===n||2===n?t:t+1,h=e.position-e.lineStart,1===m?s&&(je(e,h)||function(e,t,n){var i,r,o,a,s,l,c,u=e.tag,p=e.anchor,f={},d=Object.create(null),h=null,m=null,g=null,b=!1,y=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),c=e.input.charCodeAt(e.position);0!==c;){if(b||-1===e.firstTabInLine||(e.position=e.firstTabInLine,me(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!ne(i)){if(a=e.line,s=e.lineStart,l=e.position,!Ne(e,n,2,!1,!0))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);te(c);)c=e.input.charCodeAt(++e.position);if(58===c)ne(c=e.input.charCodeAt(++e.position))||me(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Ae(e,f,d,h,m,null,a,s,l),h=m=g=null),y=!0,b=!1,r=!1,h=e.tag,m=e.result;else{if(!y)return e.tag=u,e.anchor=p,!0;me(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=p,!0;me(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(b&&(Ae(e,f,d,h,m,null,a,s,l),h=m=g=null),y=!0,b=!0,r=!0):b?(b=!1,r=!0):me(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=i;if((e.line===o||e.lineIndent>t)&&(b&&(a=e.line,s=e.lineStart,l=e.position),Ne(e,t,4,!0,r)&&(b?m=e.result:g=e.result),b||(Ae(e,f,d,h,m,g,a,s,l),h=m=g=null),ke(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)me(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Ae(e,f,d,h,m,null,a,s,l),y&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),y}(e,h,d))||function(e,t){var n,i,r,o,a,s,l,c,u,p,f,d,h=!0,m=e.tag,g=e.anchor,b=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==d)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);0!==d;){if(ke(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=m,e.anchor=g,e.kind=c?"mapping":"sequence",e.result=o,!0;h?44===d&&me(e,"expected the node content, but found ','"):me(e,"missed comma between flow collection entries"),f=null,s=l=!1,63===d&&ne(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,ke(e,!0,t)),n=e.line,i=e.lineStart,r=e.position,Ne(e,t,1,!1,!0),p=e.tag,u=e.result,ke(e,!0,t),d=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==d||(s=!0,d=e.input.charCodeAt(++e.position),ke(e,!0,t),Ne(e,t,1,!1,!0),f=e.result),c?Ae(e,o,b,p,u,f,n,i,r):s?o.push(Ae(e,null,b,p,u,f,n,i,r)):o.push(u),ke(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(h=!0,d=e.input.charCodeAt(++e.position)):h=!1}me(e,"unexpected end of the stream within a flow collection")}(e,d)?b=!0:(a&&function(e,t){var n,i,r,o,a=1,s=!1,l=!1,c=t,p=0,f=!1;if(124===(o=e.input.charCodeAt(e.position)))i=!1;else{if(62!==o)return!1;i=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)1===a?a=43===o?3:2:me(e,"repeat of a chomping mode identifier");else{if(!((r=ae(o))>=0))break;0===r?me(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?me(e,"repeat of an indentation width identifier"):(c=t+r-1,l=!0)}if(te(o)){do{o=e.input.charCodeAt(++e.position)}while(te(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!ee(o)&&0!==o)}for(;0!==o;){for(ve(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!l||e.lineIndent<c)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>c&&(c=e.lineIndent),ee(o))p++;else{if(e.lineIndent<c){3===a?e.result+=u.repeat("\n",s?1+p:p):1===a&&s&&(e.result+="\n");break}for(i?te(o)?(f=!0,e.result+=u.repeat("\n",s?1+p:p)):f?(f=!1,e.result+=u.repeat("\n",p+1)):0===p?s&&(e.result+=" "):e.result+=u.repeat("\n",p):e.result+=u.repeat("\n",s?1+p:p),s=!0,l=!0,p=0,n=e.position;!ee(o)&&0!==o;)o=e.input.charCodeAt(++e.position);ye(e,n,e.position,!1)}}return!0}(e,d)||function(e,t){var n,i,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(ye(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,r=e.position}else ee(n)?(ye(e,i,r,!0),Ce(e,ke(e,!1,t)),i=r=e.position):e.position===e.lineStart&&we(e)?me(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);me(e,"unexpected end of the stream within a single quoted scalar")}(e,d)||function(e,t){var n,i,r,o,a,s;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return ye(e,n,e.position,!0),e.position++,!0;if(92===s){if(ye(e,n,e.position,!0),ee(s=e.input.charCodeAt(++e.position)))ke(e,!1,t);else if(s<256&&ue[s])e.result+=pe[s],e.position++;else if((a=oe(s))>0){for(r=a,o=0;r>0;r--)(a=re(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:me(e,"expected hexadecimal character");e.result+=le(o),e.position++}else me(e,"unknown escape sequence");n=i=e.position}else ee(s)?(ye(e,n,i,!0),Ce(e,ke(e,!1,t)),n=i=e.position):e.position===e.lineStart&&we(e)?me(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}me(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?b=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!ne(i)&&!ie(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&me(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Z.call(e.anchorMap,n)||me(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ke(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,s,l,c,u,p=e.kind,f=e.result;if(ne(u=e.input.charCodeAt(e.position))||ie(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(ne(i=e.input.charCodeAt(e.position+1))||n&&ie(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(ne(i=e.input.charCodeAt(e.position+1))||n&&ie(i))break}else if(35===u){if(ne(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&we(e)||n&&ie(u))break;if(ee(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,ke(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(ye(e,r,o,!1),Ce(e,e.line-s),r=o=e.position,a=!1),te(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return ye(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===n)&&(b=!0,null===e.tag&&(e.tag="?")):(b=!0,null===e.tag&&null===e.anchor||me(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===m&&(b=s&&je(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&me(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,c=e.implicitTypes.length;l<c;l+=1)if((f=e.implicitTypes[l]).resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(Z.call(e.typeMap[e.kind||"fallback"],e.tag))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,l=0,c=(p=e.typeMap.multi[e.kind||"fallback"]).length;l<c;l+=1)if(e.tag.slice(0,p[l].tag.length)===p[l].tag){f=p[l];break}f||me(e,"unknown tag !<"+e.tag+">"),null!==e.result&&f.kind!==e.kind&&me(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):me(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||b}function Me(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(ke(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!ne(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&me(e,"directive name must not be less than one character in length");0!==r;){for(;te(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!ee(r));break}if(ee(r))break;for(t=e.position;0!==r&&!ne(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&ve(e),Z.call(be,n)?be[n](e,n,i):ge(e,'unknown document directive "'+n+'"')}ke(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ke(e,!0,-1)):a&&me(e,"directives end mark is expected"),Ne(e,e.lineIndent-1,4,!1,!0),ke(e,!0,-1),e.checkLineBreaks&&X.test(e.input.slice(o,e.position))&&ge(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&we(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ke(e,!0,-1)):e.position<e.length-1&&me(e,"end of the stream or a document separator is expected")}var Oe={load:function(e,t){var n=function(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new de(e,t),i=e.indexOf("\0");for(-1!==i&&(n.position=i,me(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Me(n);return n.documents}(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new d("expected a single document in the stream, but found more")}}}.load;function Te(e){var t;const n=e.pages||[],i=e.relations||[];if(0===n.length)return{nodes:[],edges:[]};const r=new Map,o=new Map;for(const d of n)r.set(d.id,[]),o.set(d.id,0);for(const d of i)null==(t=r.get(d.from))||t.push(d.to),o.set(d.to,(o.get(d.to)||0)+1);const a=new Map,s=[];for(const d of n)0===(o.get(d.id)||0)&&(s.push(d.id),a.set(d.id,0));let l=0;for(;s.length>0;){const e=s.shift(),t=a.get(e)||0;for(const n of r.get(e)||[]){const e=t+1;e>(a.get(n)||0)&&(a.set(n,e),e>l&&(l=e));const i=(o.get(n)||1)-1;o.set(n,i),i<=0&&s.push(n)}}for(const d of n)a.has(d.id)||a.set(d.id,l+1);const c=new Map;for(const d of n){const e=a.get(d.id)||0;c.has(e)||c.set(e,[]),c.get(e).push(d.id)}const u=[],p=new Map(n.map(e=>[e.id,e]));for(const[d,h]of c){const e=-(160*h.length+60*(h.length-1))/2;h.forEach((t,n)=>{const i=p.get(t);u.push({id:t,title:(null==i?void 0:i.title)||t,x:e+220*n+80,y:130*d,layer:d})})}const f=i.map(e=>({from:e.from,to:e.to,label:e.label}));return{nodes:u,edges:f}}const Ee=["#3b82f6","#8b5cf6","#ec4899","#f59e0b","#10b981","#06b6d4","#f97316","#6366f1"];function Le({folderPath:c}){const[u,p]=e.useState(null),[f,d]=e.useState(!0),[h,m]=e.useState(null),[g,b]=e.useState(1),[y,x]=e.useState({x:0,y:0}),[A,v]=e.useState(!1),[k,w]=e.useState({x:0,y:0}),C=e.useRef(null),j=e.useRef(null),I=`${c}/.notebook/graph.yaml`,S=e.useCallback(async()=>{d(!0),m(null);try{const e=await t(I);if(!e.content)return m("graph.yaml is empty"),void p(null);const n=Oe(e.content);p(n),b(1),x({x:0,y:0})}catch{m("Cannot read .notebook/graph.yaml"),p(null)}finally{d(!1)}},[I]);e.useEffect(()=>{S()},[S]);const N=e.useCallback(e=>{e.preventDefault();const t=e.deltaY>0?-.1:.1;b(e=>Math.max(.2,Math.min(3,e+t)))},[]),M=e.useCallback(e=>{0===e.button&&(v(!0),w({x:e.clientX-y.x,y:e.clientY-y.y}))},[y]),O=e.useCallback(e=>{A&&x({x:e.clientX-k.x,y:e.clientY-k.y})},[A,k]),T=e.useCallback(()=>{v(!1)},[]),E=e.useCallback(()=>{if(!u||!j.current)return;const{nodes:e}=Te(u);if(0===e.length)return;const t=Math.min(...e.map(e=>e.x))-100,n=Math.max(...e.map(e=>e.x))+100,i=Math.min(...e.map(e=>e.y))-40,r=Math.max(...e.map(e=>e.y))+60,o=n-t,a=r-i,s=j.current.clientWidth,l=j.current.clientHeight,c=.9*Math.min(s/o,l/a,1.5);b(c),x({x:s/2-(t+n)/2*c,y:l/2-(i+r)/2*c})},[u]),{nodes:L,edges:F}=e.useMemo(()=>u?Te(u):{nodes:[],edges:[]},[u]),_=e.useMemo(()=>new Map(L.map(e=>[e.id,e])),[L]);return e.useEffect(()=>{u&&!f&&setTimeout(E,50)},[u,f,E]),f?n.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:n.jsx(o,{className:"h-5 w-5 animate-spin"})}):h||!u?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-muted-foreground text-sm px-4 text-center",children:[n.jsx("p",{children:h||"No graph data"}),n.jsxs(i,{variant:"ghost",size:"sm",onClick:()=>{S()},children:[n.jsx(r,{className:"h-3 w-3 mr-1"})," Retry"]})]}):n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 border-b shrink-0",children:[n.jsxs("span",{className:"text-xs text-muted-foreground mr-auto",children:[L.length," pages, ",F.length," relations"]}),n.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>b(e=>Math.min(3,e+.2)),children:n.jsx(a,{className:"h-3 w-3"})}),n.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>b(e=>Math.max(.2,e-.2)),children:n.jsx(s,{className:"h-3 w-3"})}),n.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:E,children:n.jsx(l,{className:"h-3 w-3"})}),n.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{S()},children:n.jsx(r,{className:"h-3 w-3"})})]}),n.jsx("div",{ref:j,className:"flex-1 overflow-hidden cursor-grab active:cursor-grabbing bg-muted/30",onWheel:N,onMouseDown:M,onMouseMove:O,onMouseUp:T,onMouseLeave:T,children:n.jsxs("svg",{ref:C,width:"100%",height:"100%",style:{userSelect:"none"},children:[n.jsx("defs",{children:n.jsx("marker",{id:"arrowhead",viewBox:"0 0 10 7",refX:"10",refY:"3.5",markerWidth:"8",markerHeight:"6",orient:"auto",children:n.jsx("polygon",{points:"0 0, 10 3.5, 0 7",className:"fill-muted-foreground/60"})})}),n.jsxs("g",{transform:`translate(${y.x}, ${y.y}) scale(${g})`,children:[F.map((e,t)=>{const i=_.get(e.from),r=_.get(e.to);if(!i||!r)return null;const o=i.y+20,a=r.y-20,s=(o+a)/2;return n.jsxs("g",{children:[n.jsx("path",{d:`M ${i.x} ${o} C ${i.x} ${s}, ${r.x} ${s}, ${r.x} ${a}`,fill:"none",className:"stroke-muted-foreground/40",strokeWidth:1.5,markerEnd:"url(#arrowhead)"}),e.label&&n.jsx("text",{x:(i.x+r.x)/2,y:s-4,textAnchor:"middle",className:"fill-muted-foreground/60",fontSize:9,children:e.label})]},`edge-${t}`)}),L.map(e=>{const t=Ee[e.layer%Ee.length];return n.jsxs("g",{transform:`translate(${e.x-70}, ${e.y-18})`,children:[n.jsx("rect",{width:140,height:36,rx:8,fill:t,fillOpacity:.15,stroke:t,strokeWidth:1.5}),n.jsx("text",{x:70,y:19,textAnchor:"middle",dominantBaseline:"middle",className:"fill-foreground",fontSize:11,fontWeight:500,children:e.title.length>14?e.title.slice(0,13)+"…":e.title})]},e.id)})]})]})})]})}export{Le as GraphPreview};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{j as e,r as t,_ as s,b as r,h as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CV3fvPu-.js","assets/index-6YjwjENM.js","assets/index-DT0eASks.css","assets/jszip.min-CWmc-JQg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as t,_ as s,b as r,h as a}from"./index-6YjwjENM.js";async function n(e){let t=a(e);const s=r();s&&(t+=`${t.includes("?")?"&":"?"}token=${encodeURIComponent(s)}`);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file: ${n.status}`);return n.arrayBuffer()}function l({filePath:r,zoom:a}){const[l,o]=t.useState(""),[i,d]=t.useState(null),[c,x]=t.useState(!0);return t.useEffect(()=>{let e=!1;return x(!0),d(null),(async()=>{try{const t=await s(()=>import("./index-CV3fvPu-.js").then(e=>e.i),__vite__mapDeps([0,1,2,3])),a=await n(r),l=await t.convertToHtml({arrayBuffer:a});e||o(l.value)}catch(t){e||d(t instanceof Error?t.message:"Failed to render docx")}finally{e||x(!1)}})(),()=>{e=!0}},[r]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):i?e.jsx("p",{className:"text-sm text-destructive p-4",children:i}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:l}})}function o({filePath:r,zoom:a}){var l;const[o,i]=t.useState([]),[d,c]=t.useState(0),[x,u]=t.useState(null),[m,p]=t.useState(!0);return t.useEffect(()=>{let e=!1;return p(!0),u(null),(async()=>{try{const t=await s(()=>import("./xlsx-DfDjAMCE.js"),[]),a=await n(r),l=t.read(a,{type:"array"}),o=l.SheetNames.map(e=>({name:e,html:t.utils.sheet_to_html(l.Sheets[e],{editable:!1})}));e||(i(o),c(0))}catch(t){e||u(t instanceof Error?t.message:"Failed to render xlsx")}finally{e||p(!1)}})(),()=>{e=!0}},[r]),m?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):x?e.jsx("p",{className:"text-sm text-destructive p-4",children:x}):0===o.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[o.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:o.map((t,s)=>e.jsx("button",{onClick:()=>c(s),className:"px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap "+(s===d?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"),children:t.name},s))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:(null==(l=o[d])?void 0:l.html)??""}}),e.jsx("style",{children:"\n .xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }\n .xlsx-preview td, .xlsx-preview th {\n border: 1px solid hsl(var(--border));\n padding: 4px 8px;\n text-align: left;\n white-space: nowrap;\n font-size: inherit;\n }\n .xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }\n .xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }\n "})]})}function i({filePath:r,zoom:a}){const[l,o]=t.useState([]),[i,d]=t.useState(null),[c,x]=t.useState(!0);return t.useEffect(()=>{let e=!1;return x(!0),d(null),(async()=>{try{const t=await n(r),a=await async function(e){const{default:t}=await s(async()=>{const{default:e}=await import("./jszip.min-CWmc-JQg.js").then(e=>e.j);return{default:e}},__vite__mapDeps([3,1,2])),r=await t.loadAsync(e),a=[],n=Object.keys(r.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/i.test(e)).sort((e,t)=>{var s,r;return parseInt((null==(s=e.match(/slide(\d+)/))?void 0:s[1])??"0")-parseInt((null==(r=t.match(/slide(\d+)/))?void 0:r[1])??"0")});for(let s=0;s<n.length;s++){const e=await r.file(n[s]).async("text"),t=[],l=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').trim();e&&t.push(e)}a.push({index:s+1,texts:t})}return a}(t);e||o(a)}catch(t){e||d(t instanceof Error?t.message:"Failed to render pptx")}finally{e||x(!1)}})(),()=>{e=!0}},[r]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):i?e.jsx("p",{className:"text-sm text-destructive p-4",children:i}):0===l.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:12*a/100+"px"},children:l.map(t=>e.jsxs("div",{className:"border border-border rounded-lg p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((t,s)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:t},s))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const d=new Set(["docx","xlsx","xls","pptx"]);function c({filePath:t,ext:s,zoom:r}){return"docx"===s?e.jsx(l,{filePath:t,zoom:r}):"xlsx"===s||"xls"===s?e.jsx(o,{filePath:t,zoom:r}):"pptx"===s?e.jsx(i,{filePath:t,zoom:r}):null}export{d as OFFICE_EXTS,c as OfficePreview};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,r as s,j as t,
|
|
1
|
+
import{c as e,r as s,j as t,b3 as a,b4 as n,b5 as l,t as r,b6 as i,b7 as o,b8 as c,b9 as d,ba as h,B as x}from"./index-6YjwjENM.js";import{Z as u,a as m,L as f,P as y,A as g}from"./ProjectPage-Deq1kcT4.js";import{M as b}from"./maximize-2-B2EYhurQ.js";import"./save-DJgFglz7.js";import"./download-D9mW-Nx-.js";import"./chevron-down-DaForMZ1.js";import"./bot-BiaPkU_j.js";import"./user-XsJCdMEa.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.309.0 - ISC
|
|
4
4
|
*
|